Weird error: [Semantical Error] line 0, col 75 near 'submit': Error: 'submit' is not defined.

Posted by luxury on Stack Overflow See other posts from Stack Overflow or by luxury
Published on 2012-06-26T03:12:47Z Indexed on 2012/06/26 3:15 UTC
Read the original article Hit count: 143

Filed under:
|
|
|

My controller like:

  /**
   * @Route("/product/submit", name="product_submit") 
   * @Template("GaorenVendorsBundle:Product:index.html.twig")
   */
  public function submitAction()
  {
        $em = $this->getDoctrine()->getManager();
        $uid = $this->getUser()->getId();
        $em->getRepository( 'GaorenVendorsBundle:Product' )->updateStatus( $uid, Product::STATUS_FREE, Product::STATUS_PENDING );

        return $this->redirect( $this->generateUrl( 'product' ) );
  }

and the repo like:

class ProductRepository extends EntityRepository {

  public function updateStatus($uid, $status, $setter)
  {
        $st = $this->getEntityManager()->getRepository( 'GaorenVendorsBundle:Product' )
              ->createQueryBuilder( 'p' )
              ->update( 'GaorenVendorsBundle:Product', 'p' )
              ->set( 'p.status', ':setter' )
              ->where( 'p.status= :status AND p.user= :user' )
              ->setParameters( array(
                      'user' => $uid,
                      'status' => $status,
                      'setter' => $setter
              ) )
              ->getQuery()
              ->execute()

        return $st;
  }

when request the "submit" action, it prompts me "[Semantical Error] line 0, col 75 near 'submit': Error: 'submit' is not defined. ". "submit" is nothing to do with DOCTRINE orm query, why it appears in the error? I just can't figure out.Anyone could tell me?

© Stack Overflow or respective owner

Related posts about orm

Related posts about symfony-2.0